import Vue from 'vue'
import VueRouter from 'vue-router'
//全局引入
import Home from '../views/Home/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/category',
    name: 'Category',
    component: () => import('../views/Category/Category.vue'),
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/find',
    name: 'Find',
    component: () => import('../views/Find/Find.vue'),
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/cart',
    name: 'Cart',
    component: () => import('../views/Cart/Cart.vue'),
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine/Mine.vue'),
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/userlogin',
    name: 'UserLogin',
    component: () => import('../views/Login/UserLogin.vue')
  },
  {
    path: '/phonelogin',
    name: 'Phonelogin',
    component: () => import('../views/Login/Phonelogin.vue')  //按需引入
  }, {
    path: "/",
    redirect: "/userlogin"
  }
]

const router = new VueRouter({
  routes
})

export default router
